const app = getApp();
const { getWebviewUrl } = require('./func');
const { PageBase } = require('../../mixins/page');

// H5 业务承载页面
Page({
    mixins: [PageBase],
    data: {
        url: '',
    },
    onLoad: function (options) {
        const { type, goodsId, goodsIds, orderNumber, title, storeId } = options;
        console.log('Webview => 参数为：', options);
        const url = getWebviewUrl(type, {
            goodsId,
            goodsIds,
            orderNumber,
            storeId,
            title,
        }, app.globalData);
        console.log('Webvew => 生成的URL为：', url)
        this.setData({
            url,
        });
    },
    onShow: function () {

    },
    bindLoading() {
        console.log('Webview => 加载完成', this.data.url);
    },
})